package com.such.kit.validate.validator.impl;

import java.util.List;
import com.such.kit.validate.ValidateDataType;
import com.such.kit.validate.ValidateNumber;
import com.such.kit.validate.validator.Validator;

/**
 * @author SUCH
 * <pre>
 * 比较是否大于校验器
 * 
 * [参数集说明]
 * 输入内容必须为数字且大于 #[1]
 * </pre>
 */
public class GtValidator extends Validator {

	@Override
	protected boolean checkParams(List<String> params) {
		if (params.size() == 1) {
			return true;
		}
		return false;
	}

	@Override
	protected boolean verify(String value, List<String> params) {
		String ckeckValue = params.get(0);
		if (ValidateDataType.validateDouble(value) && ValidateDataType.validateDouble(ckeckValue) 
				&& ValidateNumber.gt(Double.valueOf(value), Double.valueOf(ckeckValue))) {
			return true;
		}
		return false;
	}

	@Override
	protected String getVerifyMessage(List<String> params) {
		return "输入内容必须为数字且大于 #[1]";
	}

}
